<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>动态时间与直角三角形九九乘法表</title>
<style>
    body {
        font-family: Arial, sans-serif;
        text-align: center;
    }
    #current-time {
        font-size: 24px;
        margin-bottom: 20px;
    }
    .row {
        display: flex;
        justify-content: flex-start;
    }
    .cell {
        border: 1px solid black;
        padding: 10px;
    }
</style>
</head>
<body>
<h1>动态时间</h1>
<p id="current-time"></p>

<h1>九九乘法表</h1>
<div id="multiplication-table"></div>

<script>
function generateMultiplicationTable() {
    var tableHtml = '';
    for (var i = 1; i <= 9; i++) {
        tableHtml += '<div class="row">';
        for (var j = 1; j <= i; j++) {
            tableHtml += '<div class="cell">' + j + ' x ' + i + ' = ' + (j * i) + '</div>';
        }
        tableHtml += '</div>';
    }
    document.getElementById("multiplication-table").innerHTML = tableHtml;
}

generateMultiplicationTable(); // 页面加载时生成乘法表

function updateTime() {
    var now = new Date();
    var year = now.getFullYear();
    var month = now.getMonth() + 1;
    var day = now.getDate();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    var timeString = year + "年" + month + "月" + day + "日 " + hours + "时" + minutes + "分" + seconds + "秒";
    document.getElementById("current-time").innerText = "当前时间：" + timeString;
}

updateTime(); // 页面加载时更新时间
setInterval(updateTime, 500); // 每秒更新一次时间
</script>
</body>
</html>
